package cn.xspace.library.ui.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import cn.xspace.library.R;
import cn.xspace.library.view.MatrixImageView;

/**
 * Created by Administrator on 2016/11/5.
 */

public class ViewPagerFragment extends Fragment {

    private MatrixImageView imageview = null;
    private TextView textview = null;

    public static ViewPagerFragment newInstance(String image) {

        Bundle args = new Bundle();
        args.putString("src", image);

        ViewPagerFragment fragment = new ViewPagerFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_view_piture, null);
        imageview = (MatrixImageView) v.findViewById(R.id.image);
//        textview = (TextView) v.findViewById(R.id.tv_name);
        String src = (String) getArguments().get("src");
//        textview.setText(src);
//        Picasso.with(getActivity())
//                .load(src)
//                .placeholder(R.mipmap.ic_launcher)
//                .error(R.mipmap.ic_launcher)
//                .into(imageview);
        return v;
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


    }
}
